package com.wizinno.android.urineflow.data;

import lombok.Getter;

/**
 * @author LiuMei
 * @date 2020-12-14.
 */
@Getter
public enum ErrorCodeEnum {
    NO_USB_DEVICE(1, "无USB设备"),
    USB_DEVICE_NET_ERROR(2, "USB串口通讯异常"),
    ;
    private int code;
    private String desc;

    ErrorCodeEnum(int i, String s) {
        this.code = i;
        this.desc = s;
    }

    public static String getDesc(int code) {
        ErrorCodeEnum[] values = ErrorCodeEnum.values();
        for (ErrorCodeEnum value : values) {
            if (value.code == code) {
                return value.desc;
            }
        }
        return "未知";
    }
}
